import { _decorator, Node, Sprite, Toggle } from 'cc';
import { BaseUISubView } from './base/BaseUISubView';
import Mgr from '../manager/Mgr';

export class MainMenu extends BaseUISubView {
    public constructor(node:Node){
        super(node);
    }

    protected initUI(){
        let muteToggle:Toggle = this.getChildByName("muteToggle").getComponent(Toggle);
        let soundNormal:Node = muteToggle.node.getChildByName("normal");
        muteToggle.node.on(Toggle.EventType.TOGGLE,function(){
            soundNormal.active = !muteToggle.isChecked;
            Mgr.soundMgr.setMute(muteToggle.isChecked);
        });
    }

    protected initEvent(){
    }
}